package gui.obrazky;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

/**
 * Smajlik komponenta
 * @author schovjan
 * @date Feb 10, 2012
 */
public class SmajlikLabel extends JLabel {

    private static final long serialVersionUID = 1L;
    private ImageIcon usmev;
    private ImageIcon smutek;


    /**
     * konstruktor
     */
    public SmajlikLabel() {
	super();
	usmev = new ImageIcon(getClass().getResource("/gui/img/usmev.png"));
	smutek = new ImageIcon(getClass().getResource("/gui/img/smutek.png"));
	this.setBackground(Color.BLACK);
	this.setMinimumSize(new Dimension(200, 200));
	this.setPreferredSize(new Dimension(200, 200));
	this.setSize(new Dimension(200, 200));
    }


    /**
     * nastavi usmev
     */
    public void usmat() {
	this.setIcon(usmev);
	this.repaint();
    }


    /**
     * nastavi smutek
     */
    public void smutnit() {
	this.setIcon(smutek);
	this.repaint();
    }


    /**
     * Smaze tvar a zobrazi jen prazdnou plochu
     */
    public void nullovat() {
	this.setIcon(null);
	this.repaint();
    }
}
